import java.sql.SQLOutput;

public class CodeBlock4 {
    public static void main(String[] args) {
        new BBB2();
    }
}

class AAA2{
    private String name;
    private static int n1=getN1();
    static{
        System.out.println("AAA2的静态代码块被调用...");
//        System.out.println(name); 静态代码块没有传入普通对象和普通方法
//        静态代码块只能传入静态对象和静态方法
        System.out.println(n1);
    }
    {
        System.out.println("AAA2普通代码块被调用");
    }
    public AAA2(){
        System.out.println("AAA2的构造方法被调用");
    }
    public static int getN1(){
        return 100;
    }
}


class BBB2 extends AAA2{

    static{
        System.out.println("BBB2的静态代码块被调用...");
    }
    {
        System.out.println("BBB2的普通代码块被调用");
    }
    public BBB2(){
        System.out.println("BBB2的构造方法被调用");
    }
}
